package halberd.io;

import java.awt.image.BufferedImage;

import halberd.ImgIn;
import halberd.data.ImgData;
import halberd.data.ImgDataFactory;
import halberd.utils.BufferedImageToImgData;
public class BufferedImageIn implements ImgIn<BufferedImage>{
	public ImgData convert(BufferedImage image) {
		if(image==null){
			return null;
		}
		int h=image.getHeight();
		int w=image.getWidth();
		ImgData imgData=ImgDataFactory.createImgData(w,h);
		BufferedImageToImgData.fillRGB(image, imgData); 
		return imgData;
	}

}
